When a
programmer is crafting a program, it is good practice to break the program
down into pieces that can be thought of independently. Once the program has
been completed, we can think of its execution as being a series of these
pieces that work together in a certain sequence. These pieces then pass the
control of the program between each other. While one piece has the control,
the other pieces are inactive. This is known as the flow of control in a
program. |
|
control
statements |
|
Control
Statements, then, are ways for a programmer to control what pieces of the
program are to be executed at certain times. The syntax of Control statements
are very similar to regular english, and are very similar to choices that we
make every day. There are two basic types of control statements: branching
statements and loops. |